<%@ page pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/base/taglibs.jsp"%>
<html>
	<head>
		<link href="${ctx}/css/main.css" rel="stylesheet" type="text/css" />
		<script language="javascript">
			function doDelete(action,id){
				if(confirm('是否确认删除？')){
					location.href = "${ctx}/" + action + "?id=" + id ;
				}
			}
			
			function submitAction(action){
				document.manageForm.action = action ;
				document.manageForm.submit();
			}
			
			function saveAction(action) {
				if(document.getElementById("displayFlag").value == '1' && document.getElementById("replyContent").value == ''){
					if(confirm('回复内容未填写，是否保存？')){
						submitAction(action);
					}
				} else {
					submitAction(action);
				}
			}
		</script>
	</head>
	
	<body>
		<form method="post" action="" name="manageForm">
			<table border="0" cellspacing="1" cellpadding="3" align="center" width="100%">
				<tr>
					<td class="td11" align="left" colspan="4">
						<input type="button" name="save" value="保存" onClick="saveAction('saveMessageBoard.ac')">
						&nbsp;&nbsp;<input type="button" name="delete" value="删除" onClick="doDelete('deleteMessageBoard.ac','${messageBoard.id}')">
						&nbsp;&nbsp;<input type="button" name="back" value="返回" onClick="submitAction('messageBoardManage.ac')">
					</td>
				</tr>
				<tr>
					<td width="20%" class="td2">
						是否显示  <span style="color:red;vertical-align:middle;">*</span>
					</td>
					<td width="30%" class="td2">
						<input type="hidden" name="id" value="${messageBoard.id}">
						<select name="displayFlag" id="displayFlag" style="width:200px">
							<c:if test="${messageBoard.displayFlag == '1'}">
								<option value="1" selected="selected">显示</option>
								<option value="0">不显示</option>
							</c:if>
							<c:if test="${messageBoard.displayFlag != '1'}">
								<option value="1" >显示</option>
								<option value="0" selected="selected">不显示</option>
							</c:if>
						</select>
					</td>
					<td width="20%" class="td2">
						留言商品名
					</td>
					<td width="30%" class="td2">
						<input type="text" readonly="readonly" style="color:grey" name="prodName" size="35" value="${messageBoard.prodName}">
					</td>
				</tr>
				<tr>
					<td width="20%" class="td2">
						留言人
					</td>
					<td width="30%" class="td2">
						<input type="text" readonly="readonly" style="color:grey" name="creator" size="32" value="${messageBoard.creator}">
					</td>
					<td width="20%" class="td2">
						留言日期
					</td>
					<td width="30%" class="td2">
						<input type="text" readonly="readonly" style="color:grey" name="messageDate" size="35" value="${messageBoard.messageDate}">
					</td>
				</tr>
				<tr>
					<td width="20%" class="td2">
						留言内容 
					</td>
					<td width="100%" class="td2" colspan="3">
						<textarea style="color:grey" readonly="readonly" name="message" rows="3" cols="80">${messageBoard.message}</textarea>
					</td>
				</tr>
				<tr>
					<td width="20%" class="td2">
						回复内容 
					</td>
					<td width="100%" class="td2" colspan="3">
						<textarea name="replyContent" rows="3" cols="80">${messageBoard.replyContent}</textarea>
					</td>
				</tr>
			</table>
			<BR>
		</form>
	</body>
</html>